package Stream.终端操作;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class Filter {
    public static void main(String[] args) {
        Stream<Integer> integerStream = Stream.of(-1, 1, 2, 3);
        List<Integer> collect = integerStream.filter(num -> num > 1)
                .collect(Collectors.toList());
        //也可以 toMap或者toSet
        System.out.println(collect);
        
        //对Map进行分组和分区功能:
        //Collectors.groupingBy()
        //Collectors.partitioningBy()
    }
}
